<?php use_stylesheet('home.css') ?>
<?php use_stylesheet('jquery.fancybox-1.3.4.css') ?>

<?php use_javascript('jquery-1.8.2.min.js') ?>
<?php use_javascript('jquery.carouFredSel-6.2.0-packed.js') ?>
<?php use_javascript('helper-plugins/jquery.mousewheel.min.js') ?>
<?php use_javascript('helper-plugins/jquery.touchSwipe.min.js') ?>
<?php use_javascript('helper-plugins/jquery.transit.min.js') ?>
<?php use_javascript('helper-plugins/jquery.ba-throttle-debounce.min.js') ?>
<?php use_javascript('dotimeout.js') ?>
<?php use_javascript('jquery.fancybox-1.3.4.pack.js') ?>


    <section id="sectionWelcome">
        <?php include_component('componente','welcome') ?>
    </section>              


    <section id="bloqueHeader">  <?php include_component('componente','header') ?>    </section>
    <section id="bloqueBaner">      </section>
    <section id="sectionNav"><?php include_component('componente','nav') ?> </section>    
    
    <section id="bloqueBuscador"> <?php include_component('componente','search') ?>    </section>
  
    <section id="sectionBodyHome">
        <div style="padding-top: 18px;">
            <?php echo image_tag('vermas.png') ?>
        </div>
        <hr>
        <div id="contenedor" style="text-align: left;padding-left: 2%;width: 67%;background-color: #FFF;">
            <?php $lista = $sf_user->getAttribute('s_favorito',null); ?>
            <?php if($lista!=null): ?>
            <?php foreach($lista as $row): ?>
            <div id="detalleProducto">
                <div><a href="javascript:mostarDetalle('<?php echo $row['objeto']->getId(); ?>')"><?php echo image_tag('ejemplo/'.$row['objeto']->getRutaDocumento()) ?></a></div>
                <div>
                    <ul>
                        <li><a href="javascript:mostarDetalle('<?php echo $row['objeto']->getId(); ?>')"><h2><?php echo strtoupper(  $row['objeto']->getTitulo() );  ?></h2></a>&nbsp;&nbsp;<h3><?php echo $row['objeto']->getAutor(); ?></h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo image_tag('estrellaroja.png') ?>&nbsp;<?php echo image_tag('estrellaroja.png') ?>&nbsp;<?php echo image_tag('estrellaroja.png') ?>&nbsp;<?php echo image_tag('estrellagris.png') ?>&nbsp;<?php echo image_tag('estrellagris.png') ?></li>
                        <li style="height: 85px;overflow: hidden;line-height: 23px;">
                            <p><?php echo strtolower( $row['objeto']->getResumenDocumento()); ?></p>                            
                        </li>
                        <li><a class="botonPago" href="<?php echo url_for('carrito/agregarCarrito?idDocumento='.$row['objeto']->getId()) ?>"><?php if($row['objeto']->getTipoDocumentoPago()=="2"){ echo '$ '.strtolower( $row['objeto']->getPrecio()); }else { echo "Gratis"; } ?></a></li>
                    </ul>
                </div>
            </div>
           <hr style="width: 96%;margin: 15px 0px;">
            <?php endforeach; ?>
            <?php endif; ?>
            
            
        </div>
        
    </section>
    <script type="text/javascript">
    
           function mostarDetalle(id)
           {               
               $.ajax({
                  url:     '<?php echo url_for('@ajaxContentDetalle') ?>',
                  data:    { idDocumento : id },
                  success: function(data)
                  {
                        $.fancybox({
                            'content' : data
                          });
                  }
                 });
           }
               
          
                
          
          
              
           
  </script>